package com.jichaoyun.dao.mapper;


import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jichaoyun.model.entity.Realdata;
import com.jichaoyun.model.entity.RealdataCache;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
* @author zhen
* @description 针对表【realData_cache】的数据库操作Mapper
* @createDate 2023-12-20 15:25:03
* @Entity com.jichaoyun.model.entity.RealdataCache
*/
@Mapper
public interface RealdataCacheMapper extends BaseMapper<RealdataCache> {
    RealdataCache selectRecentOneByStation(@Param("station_no")Integer station_no);

    RealdataCache getStationSingleInfoById(Integer station_no);
    @DS("water")
    RealdataCache getWaterStationSingleInfoById(Integer station_no);
    @MapKey("record_time")
    List<Map<String, Object>> getRealDatabyId(Integer station_no);

    List<RealdataCache> selectTop5Flow();

    List<RealdataCache> selectTop5Temp();

    List<RealdataCache> selectTop5Pres();

    List<RealdataCache> selectTop5FlowSelf(Integer userId);

    List<RealdataCache> selectTop5TempSelf(Integer userId);

    List<RealdataCache> selectTop5PresSelf(Integer userId);

    List<RealdataCache> getMultiRealInfo();

    List<RealdataCache> getMultiRealInfoBy(@Param("lineId") Integer lineId,@Param("identity") String identity, @Param("orderType") String orderType);
    @DS("water")
    List<RealdataCache> waterSelectList(@Param("stationNo") Integer stationNo, @Param("start") LocalDateTime start, @Param("end") LocalDateTime end);


    RealdataCache historySelectOne(Integer stationNo, LocalDateTime start, LocalDateTime end);
}




